﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace RatpConsole
{
    class ProbeManager
    {
        // Singleton (~TSafe)
        private static ProbeManager instance = null;
        private static readonly object lockobj = new object();
        private ProbeManager() { } 
        public static ProbeManager getInstance()
        {
            lock (lockobj)
            {
                if (instance == null) instance = new ProbeManager();
                return instance;
            }
        }

        // Members
        private int seq = 0;
        private ArrayList probes = new ArrayList();

        public void register(Probe probe)
        {
            probe.Id = seq;
            seq++;
            probes.Add(probe);
        }

        public ArrayList listProbes()
        {
            return probes;
        }

    }
}
